﻿@{
    ViewBag.Title = "AddReturnOrderView";
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Demo</title>

    <link href="//unpkg.com/layui@2.9.17/dist/css/layui.css" rel="stylesheet">
    <link href="~/scripts/layui-v2.5.6/layui/css/layui.mobile.css" rel="stylesheet" />
    <link href="~/scripts/layui-v2.5.6/layui/css/layui.css" rel="stylesheet" />
    <script src="~/scripts/layui-v2.5.6/layui/layui.all.js"></script>
    <script src="~/scripts/layui-v2.5.6/layui/layui.js"></script>
</head>
<body>
    <form class="layui-form" action="" onsubmit="return false">
        <div class="layui-form-item">
            <label class="layui-form-label">退货单编号</label>
            <div class="layui-input-block">
                <input type="text" id="rtCode" name="rtCode" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">退货单名称</label>
            <div class="layui-input-block">
                <input type="text" id="rtName" name="rtName" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">采购订单编号</label>
            <div class="layui-input-block">
                <input type="text" id="soCode" name="soCode" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">供应商</label>
            <div class="layui-input-block">
                <input type="text" id="clientName" name="clientName" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>
        @*
        <div class="layui-form-item">
        <label class="layui-form-label">批次号</label>
        <div class="layui-input-block">
        <input type="text" name="warehouseCode" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
        </div>
        *@
        <div class="layui-form-item">
            <label class="layui-form-label">退货日期</label>
            <div class="layui-input-inline">
                @* <input type="text" class="layui-input" name="rtDate" placeholder="yyyy-MM-dd"> *@
                <input type="date" id="rtDate" name="rtDate" lay-verify="date" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">单据状态</label>
            <div class="layui-input-inline layui-input-wrap">
                <select name="status" id="status" lay-verify="required" lay-search>
                    <option value="" name="status">请选择单据状态</option>
                    <option value="0" name="status">未完成</option>
                    <option value="1" name="status">已完成</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" id="remark" name="remark"></textarea>
            </div>
        </div>

    </form>
    <script src="~/Scripts/jquery-3.4.1.min.js"></script>
    <script src="//unpkg.com/layui@2.9.17/dist/layui.js"></script>
    <script src="~/libs/jquery/jquery.js"></script>

    <script type="text/javascript">
        layui.use('form', function () {
            var form = layui.form;
            form.render();

            // 自定义验证规则
            // form.verify({
            //     rtCode: function (value) {
            //         if (!value) { layer.msg("退货单编号不能为空"); return true; };
            //     },
            //     rtName: function (value) {
            //         if (!value) { layer.msg("退货单名称不能为空"); return true; };
            //     },
            //     soCode: function (value) {
            //         if (!value) { layer.msg("采购订单编号不能为空"); return true; };
            //     },
            //     clientName: function (value) {
            //         if (!value) { layer.msg("供应商不能为空"); return true; };
            //     },
            //     warehouseCode: function (value) {
            //         if (!value) { layer.msg("批次号不能为空"); return true; };
            //     },
            //     rtDate: function (value) {
            //         if (!value) { layer.msg("退货日期不能为空"); return true; };
            //     },
            //     status: function (value) {
            //         if (!value) { layer.msg("单据状态不能为空"); return true; };
            //     },
            //     remark: function (value) {
            //         if (!value) { layer.msg("备注不能为空"); return true; };
            //     }
            // });

            // //随机数
            // function generateRandomNumber() {
            //     var num = Math.floor(1000 + Math.random() * 9000); // 生成1000到9999之间的随机数
            //     var number = "WS" + num
            //     return number;
            // }
        })
    </script>
</body>
</html>